Avoid creating _base declarations#61087
Avoid creating _base declarations#61087CraigMacomber wants to merge 2 commits intomicrosoft:mainfrom
Conversation
| const varDecl = factory.createVariableDeclaration(newId, /*exclamationToken*/ undefined, resolver.createTypeOfExpression(extendsClause.expression, input, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); | ||
| const statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier(SyntaxKind.DeclareKeyword)] : [], factory.createVariableDeclarationList([varDecl], NodeFlags.Const)); | ||
| const baseType = resolver.createTypeOfExpression(extendsClause.expression, input, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker); | ||
| const extendsExpression = factory.createAsExpression(factory.createObjectLiteralExpression(), baseType!); // TODO: GH#18217 |
There was a problem hiding this comment.
Having never worked on this code before, and the relevant types and methods mostly being undocumented, I don't know why this createTypeOfExpression might return undefined or if ignoring undefined values here is safe to do here.
I'm also not sure if putting the // TODO: GH#18217 makes sense or not: it seemed to be used to track questionable use of ! (like the one I removed below) so I left it here to help draw attention to the ! here.
|
The TypeScript team hasn't accepted the linked issue #59550. If you can get it accepted, this PR will have a better chance of being reviewed. |
1 similar comment
|
The TypeScript team hasn't accepted the linked issue #59550. If you can get it accepted, this PR will have a better chance of being reviewed. |
Fixes #59550